<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
  xmlns:widget="http://www.netvibes.com/ns/">
<head>
<meta name="author" content="Mahin" />
<meta name="description" content="To-Do list" />
<meta name="apiVersion" content="1.0" />
<meta name="autoRefresh" content="30" />
<meta name="debugMode" content="false" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Expires" content="" />
<meta name="inline" content="true" />
<widget:preferences>
  <preference name="tsks" type="hidden" defaultValue="" />
  <preference name="locs" type="hidden" defaultValue="" />
  <preference name="ver" type="hidden" defaultValue="v2" />
</widget:preferences>
<title>To-Do List</title>
<link rel="icon" type="image/png" href="http://www.netvibes.com/favicon.ico" />
<style type="text/css">
.SZTodo {
	font-size: 12px;
	font-family: "Lucida Grande", Arial, "Trebuchet MS", Verdana, sans-serif;
	color: #454545;
	padding:1px 2px 2px 1px;
}
.SZTodo a:link{
	text-decoration: none;
}
.SZTodo a:visited{
	text-decoration: none;
}
.SZTodo input[type="text"]{
	font-size:11px;
	height: 17px;
}
.SZTodo select{
	font-size:10px;
	height: 17px;
}
.SZTodo input[type="submit"]{
	border:1px solid #000000;
	height: 17px;
}
.SZTodo form{
	margin: 0px;
}
.SZTodo img{
	border-style: none;
}
.SZTodo table{
	border-collapse:collapse;
	font-size: 12px;
}
.SZTodo th{
	text-align:left;
	padding: 1px 1px 1px 10px;
	font-size: 11px;
	border-bottom: 1px solid #cccccc;
}
.SZTodo th a {
	font-weight: normal;
}
.SZTodo td{
	padding: 1px 1px 1px 1px;
}
.SZEdit {
	background-color: #e4ecec;
	padding: 2px 2px 2px 2px;
}
.SZMain th{
	text-align:left;
	padding: 1px 1px 1px 2px;
	font-size: 11px;
	border-bottom: 1px solid #cccccc;
}
.SZMain td{
	white-space: normal;
	font-size: 12px;
	padding: 1px 1px 1px 1px;
	border-bottom:1px solid #cccccc;
}
.SZPlain td{
	border-bottom:0px solid #cccccc;
	padding:1px 1px 1px 1px;
}
.SZPlain td div{
	width:100%;
	overflow: hidden;
}
.SZMain a{
	text-decoration: none;
}
.SZCont {
	background: transparent url(http://screeperzone.googlecode.com/files/show.gif) no-repeat 0px 2px;
	padding-left: 10px;
}
.SZCont table{
	table-layout:fixed;
}
.SZShow {
	background: transparent url(http://screeperzone.googlecode.com/files/hide.gif) no-repeat 0px 2px;
	background-color:#efefef;
	padding-left: 10px;
	font-weight: bold;
}
.SZShow table{
	table-layout:fixed;
}
.SZCont .SZSub {
	display:none;
}
.SZShow .SZSub {
	padding: 1px 2px 1px 1px;
	background-color:#ffffff;
	font-weight: normal;
}
.SZSub td div{
	width:100%;
	overflow: hidden;
}
.SZSmall {
	font-size:9px;
}
.SZbgrd{
	background-color: #e4ecec;
	padding: 3px 3px 3px 3px;
	border: 1px solid #cccccc;
}
.SZ2{
	color:#ffffff;
	font-weight: bolder;
	background-color: blue;
	padding: 0px 2px 0px 2px;
}
.SZ1{
	color:#ffffff;
	font-weight: bolder;
	background-color: red;
	padding: 0px 2px 0px 2px;
}
.SZ3{
	color:#ffffff;
	font-weight: bolder;
	background-color: green;
	padding: 0px 2px 0px 2px;
}
.SZeloc {
	border-bottom:1px solid #999999;
	padding:2px 2px 2px 2px;
}
</style>
<link rel="stylesheet" type="text/css" href="http://www.netvibes.com/themes/uwa/style.css" />
<script type="text/javascript" src="http://www.netvibes.com/js/UWA/load.js.php?env=Standalone"></script>
<script type="text/javascript">
var JSON=function(){var m={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r","\"":"\\\"","\\":"\\\\"},s={"boolean":function(x){return String(x);},number:function(x){return isFinite(x)?String(x):"null";},string:function(x){if(/["\\\x00-\x1f]/.test(x)){x=x.replace(/([\x00-\x1f\\"])/g,function(a,b){var c=m[b];if(c){return c;}c=b.charCodeAt();return "\\u00"+Math.floor(c/16).toString(16)+(c%16).toString(16);});}return "\""+x+"\"";},object:function(x){if(x){var a=[],b,f,i,l,v;if(x instanceof Array){a[0]="[";l=x.length;for(i=0;i<l;i+=1){v=x[i];f=s[typeof v];if(f){v=f(v);if(typeof v=="string"){if(b){a[a.length]=",";}a[a.length]=v;b=true;}}}a[a.length]="]";}else{if(x instanceof Object){a[0]="{";for(i in x){v=x[i];f=s[typeof v];if(f){v=f(v);if(typeof v=="string"){if(b){a[a.length]=",";}a.push(s.string(i),":",v);b=true;}}}a[a.length]="}";}else{return;}}return a.join("");}return "null";}};return {copyright:"(c)2005 JSON.org",license:"http://www.crockford.com/JSON/license.html",stringify:function(v){var f=s[typeof v];if(f){v=f(v);if(typeof v=="string"){return v;}}return null;},parse:function(_12){try{return !(/[^,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]/.test(_12.replace(/"(\\.|[^"\\])*"/g,"")))&&eval("("+_12+")");}catch(e){return false;}}};}();
var SZ={};SZ.load=function(){var _1=SZ.get("tsks");var _2=SZ.get("locs");if(_1){_1=_1.replace(/[\\]+/g, "");SZ.Store.setTodos(JSON.parse(_1));}if(_2){_2=_2.replace(/[\\]+/g, "");SZ.LocStore.setLocs(JSON.parse(_2));}SZ.rndr();};SZ.trim=function(s){if(s){return SZ.escJS(s.replace(/^\s+|\s+$/,""));}else{return "";}};SZ.escJS=function(s){if(s){return s.replace(/(["'\f\b\n\t\r])/gm,"");}else{return "";}};SZ.upVer=function(){var _6=SZ.Store.getAll();if(_6&&_6.length>0){var d=SZ.byId("_SZP_msg");d.style.display="";var _8=new Array(_6.length),_9,_a;for(var i=0;i<_6.length;i++){_9=new SZ.Todo();_9.id=_6[i].id;_9.d=_6[i].d;_9.locs=_6[i].locs;_9.pty=_6[i].pty;_9.ts=_6[i].ts;_9.st=_6[i].st;_9.sh=_6[i].sh;_8.push(_9);}str=JSON.stringify(_8);SZ.Store.setTodos(JSON.parse(str));SZ.Store.save();d.style.display="none";}};SZ.mon=function(_c){switch(_c){case 0:return SZ.i18n("Jan");case 1:return SZ.i18n("Feb");case 2:return SZ.i18n("Mar");case 3:return SZ.i18n("Apr");case 4:return SZ.i18n("May");case 5:return SZ.i18n("Jun");case 6:return SZ.i18n("Jul");case 7:return SZ.i18n("Aug");case 8:return SZ.i18n("Sep");case 9:return SZ.i18n("Oct");case 10:return SZ.i18n("Nov");case 11:return SZ.i18n("Dec");}};SZ.days=function(_d,_e){if(!_d||!_e){return null;}var _f=_d-_e;if(_f>0){_f=_f/86400000;return Math.ceil(_f);}return 0;};SZ.popDate=function(_10,_11){if(!_11){_11=(new Date()).getTime();}var _12=new Date(_11);_10[0].value=_12.getDate();_10[1].selectedIndex=_12.getMonth();_10[2].value=_12.getFullYear();};SZ.rdDate=function(_13){var day=parseInt(_13[0].value);if(!day||day<=0||day>31){alert(SZ.i18n("vdate"));return null;}var _15=parseInt(_13[1].value);var _16=parseInt(_13[2].value);if(!_16||_16<2007){alert(SZ.i18n("vyear"));return null;}var _17=new Date(0);_17.setDate(day);_17.setMonth(_15);_17.setFullYear(_16);_17.setHours(0);return _17;};SZ.byId=function(_18){return document.getElementById(_18);};SZ.cElm=function(_19){return widget.createElement(_19);};SZ.bdy=function(){return widget.body;};SZ.ptyMap=function(_1a){switch(_1a){case 1:return SZ.i18n("1");case 2:return SZ.i18n("2");case 3:return SZ.i18n("3");}};SZ.LocStore=function(){this.locs;};SZ.LocStore.save=function(){SZ.set("locs",JSON.stringify(this.locs));};SZ.LocStore.add=function(_1b){if(_1b){_1b=SZ.trim(_1b);if(SZ.LocStore.hasLoc(_1b)){return;}if(!this.locs){this.locs={};}var id="l"+(new Date()).getTime();this.locs[id]=_1b;SZ.LocStore.save();}};SZ.LocStore.hasLoc=function(_1d){if(this.locs){for(key in this.locs){if(this.locs[key]==_1d){return true;}}}return false;};SZ.LocStore.rmv=function(id){if(id in this.locs){delete this.locs[id];SZ.LocStore.save();}};SZ.LocStore.getAll=function(){return this.locs;};SZ.LocStore.setLocs=function(_1f){this.locs=_1f;};SZ.LocStore.get=function(key){return this.locs[key];};SZ.Task=function(id){this.id=id;this.st=0;this.d;};SZ.Todo=function(id,_23){this.id=id;this.d;this.locs;this.pty=_23;this.ts;this.st=0;this.sh=0;this.du;this.rm;};SZ.Store=function(){this.todos;this.tblDnD;this.dnds;};SZ.Store.rmvLoc=function(_24,_25){if(_25 in _24.locs){delete _24.locs[_25];}};SZ.Store.addLoc=function(_26,_27){if(_26.locs==null){_26.locs={};}_26.locs[_27]=1;};SZ.Store.addTask=function(_28,_29,_2a){if(_29){if(!_28.ts){_28.ts=new Array();}if(_2a==null){_28.ts.push(_29);}else{_28.ts.splice(_2a,0,_29);}}};SZ.Store.rmvTask=function(_2b,_2c){if(_2c&&_2b.ts){var _2d=_2b.ts;for(var i=0;i<_2d.length;i++){if(_2d[i].id==_2c){_2d.splice(i,1);return true;}}}return false;};SZ.Store.tick=function(_2f,_30,_31){if(_30&&_2f.ts){var _32=_2f.ts;for(var i=0;i<_32.length;i++){if(_32[i].id==_30){_32[i].st=(_31?1:0);return;}}}};SZ.Store.setTodos=function(_34){this.todos=_34;};SZ.Store.save=function(){SZ.set("tsks",JSON.stringify(this.todos));};SZ.Store.getAll=function(){return this.todos;};SZ.Store.get=function(_35){if(_35>=0){return this.todos[_35];}return null;};SZ.Store.addTblDnD=function(Dnd){this.tblDnD=Dnd;};SZ.Store.getTblDnD=function(){return this.tblDnD;};SZ.Store.rmvAllSubDnD=function(){this.dnds=null;};SZ.Store.addSubDnD=function(id,_38){if(!this.dnds){this.dnds=new Array();}this.dnds[id]=_38;};SZ.Store.rmvSubDnD=function(id){if(this.dnds[id]){this.dnds[id].uninit();this.dnds[id]=null;}};SZ.Store.getSubDnD=function(id){return this.dnds[id];};SZ.Store.sortD=function(){if(this.todos){var _3b=this.todos,_3c,_3d=false;for(var i=0;i<_3b.length-1;i++){var _3f=i;for(var j=i+1;j<_3b.length;j++){if(!_3b[_3f].du&&!_3b[j].du){continue;}if(!_3b[_3f].du||(_3b[j].du&&_3b[j].du<_3b[_3f].du)){_3f=j;}}if(_3f!=i){_3c=_3b[i];_3b[i]=_3b[_3f];_3b[_3f]=_3c;_3d=true;}}if(_3d){SZ.Store.save();}}else{alert(SZ.i18n("ntask"));}SZ.sortC();};SZ.Store.sort=function(){if(this.todos){var _41=-1;var _42;for(var i=0;i<this.todos.length;i++){if(this.todos[i].pty==1){if(i!=(_41+1)){_42=this.todos[i];this.todos.splice(i,1);this.todos.splice(++_41,0,_42);}else{_41=i;}}}var _44=_41;for(var j=_41+1;j<this.todos.length;j++){if(this.todos[j].pty==2){if(j!=(_44+1)){_42=this.todos[j];this.todos.splice(j,1);this.todos.splice(++_44,0,_42);}else{_44=j;}}}SZ.Store.save();}else{alert(SZ.i18n("ntask"));}SZ.sortC();};SZ.sortO=function(){SZ.byId(SZ.Map("srt")).style.display="";SZ.adjH();};SZ.sortC=function(){SZ.byId(SZ.Map("srt")).style.display="none";SZ.adjH();};SZ.Store.add=function(_46){_46=SZ.trim(_46);if(!_46||_46.length<=0){return;}var _47=new SZ.Todo((new Date()).getTime(),3);_47.d=_46;if(!this.todos){this.todos=new Array();}this.todos.push(_47);SZ.Store.save();var dom=SZ.dom(_47,(this.todos.length-1),true);SZ.byId(SZ.Map("bdy")).appendChild(dom);if(SZ.byId(SZ.Map("edtW")).style.display!=""){SZ.byId("SZSubTxt"+_47.id).focus();}SZ.Store.getTblDnD().initRow(dom);var _49=SZ.byId("SZsub"+_47.id);var _4a=new SZ.DDrop();_4a.init(_49);SZ.Store.addSubDnD("s"+_47.id,_4a);SZ.adjH();};SZ.Store.rmv=function(_4b){if(this.todos){for(var i=0;i<this.todos.length;i++){if(this.todos[i].id==_4b){this.todos.splice(i,1);SZ.Store.rmvSubDnD("s"+_4b);SZ.Store.save();return true;}}}return false;};SZ.Store.find=function(_4d){if(this.todos&&_4d){for(var i=0;i<this.todos.length;i++){if(this.todos[i].id==_4d){return this.todos[i];}}}return null;};SZ.Store.swap=function(_4f,_50,_51){if(_4f==_50||_4f==null||_50==null){return;}var _52=null;if(_51){var _53=SZ.Store.find(_51);if(_53){_52=_53.ts;}}else{_52=this.todos;}if(_52){var _53=_52[_4f];_52.splice(_4f,1);_52.splice(_50,0,_53);SZ.Store.save();SZ.rndr();}};SZ.dom=function(_54,_55,_56,_57){if(_54){var _58=SZ.cElm("tr");_58.id=_54.id;_58.setAttribute("szi",_55);var _59=SZ.cElm("td");var _5a=SZ.cElm("div");var _5b=SZ.cElm("table");_5b.style.width="100%";_5b.className="SZPlain";if(_54.sh||_56){_5a.className="SZShow";_5b.onclick=function(){SZ.hide(this);return false;};}else{_5a.className="SZCont";_5b.onclick=function(){SZ.show(this);return false;};}var _5c=SZ.cElm("tr");var td1=SZ.cElm("td");td1.innerHTML=_54.st?"<div><s>"+_54.d+"</s></div>":"<div>"+_54.d+"</div>";_5c.appendChild(td1);if(_57){var _5e=SZ.days(_54.du,_57.getTime());if(_5e!=null){var _5f=SZ.cElm("td");_5f.align="right";_5f.width="25";_5f.innerHTML="<b><span style=\"font-size:10px;color:blue\" title=\""+_5e+" days left\">"+_5e+"&nbsp;d</span></b>";_5c.appendChild(_5f);}}var td2=SZ.cElm("td");td2.align="right";td2.nowrap="nowrap";td2.width="42";td2.innerHTML="<span class=\"SZ"+_54.pty+"\" onclick=\"SZ.cPty(this, "+_54.id+");event.cancelBubble=true;return false;\" onmousedown=\"event.cancelBubble=true;return false;\">"+SZ.ptyMap(_54.pty)+"</span> <a href=\"/\" onclick=\"SZ.edit("+_55+");event.cancelBubble=true;return false;\"><img src=\"http://screeperzone.googlecode.com/files/edit.gif\" /></a>&nbsp;<a href=\"/\" onclick=\"SZ.rmv("+_54.id+");event.cancelBubble=true;return false;\"><b>X</b></a>";_5c.appendChild(td2);var _61=SZ.cElm("tbody");_61.appendChild(_5c);_5b.appendChild(_61);var _62=SZ.cElm("div");_62.className="SZSub";var _63=SZ.subDom(_54);_62.appendChild(_63);var _64=SZ.cElm("div");_64.className="SZMed";_64.innerHTML="<form onsubmit=\"SZ.subTsk(this, "+_54.id+");return false;\" onmousedown=\"event.cancelBubble=true;\" ><input type=\"text\" value=\"\" name=\"SZsubTsk\" id=\"SZSubTxt"+_54.id+"\"/><input type=\"submit\" value=\" + \"/>&nbsp;<a href=\"/\" onclick=\"SZ.prnt("+_54.id+");return false;\"><img src=\"http://screeperzone.googlecode.com/files/print.gif\" /></a></form>";_62.appendChild(_64);_5a.appendChild(_5b);_5a.appendChild(_62);_59.appendChild(_5a);_58.appendChild(_59);return _58;}return null;};SZ.subDom=function(_65){var _66=SZ.cElm("tbody");if(_65.ts&&_65.ts.length>0){var tr,td,_69,_6a;for(var i=0;i<_65.ts.length;i++){tr=SZ.cElm("tr");td=SZ.cElm("td");_69=_65.ts[i];tr.id=_69.id;tr.setAttribute("szi",i);tr.setAttribute("pid",_65.id);td.innerHTML="<div><input type=\"checkbox\" onmousedown=\"event.cancelBubble=true;\" "+(_69.st?"checked=\"checked\"":"")+" onclick=\"SZ.sStrike("+_65.id+", "+_69.id+", this);\" /><span>"+(_69.st?"<s>"+_69.d+"</s>":""+_69.d)+"</span></div>";_6a=SZ.cElm("td");_6a.align="right";_6a.width="10";_6a.innerHTML="<a href=\"/\" onclick=\"SZ.sRmv("+_65.id+","+_69.id+", this);event.cancelBubble=true;return false;\" ><b>X</b></a>";tr.appendChild(td);tr.appendChild(_6a);_66.appendChild(tr);}}var _6c=SZ.cElm("table");_6c.width="100%";_6c.id="SZsub"+_65.id;_6c.appendChild(_66);return _6c;};SZ.cPty=function(_6d,_6e){if(_6d){_6d.innerHTML="<select onchange=\"SZ.setPty("+_6e+", this, event);event.cancelBubble=true;return false;\" onclick=\"event.cancelBubble=true;return false;\"><option value=\"3\" "+(_6d.innerHTML==SZ.ptyMap(3)?"selected=selected":"")+">"+SZ.i18n("low")+"</option><option value=\"2\" "+(_6d.innerHTML==SZ.ptyMap(2)?"selected=selected":"")+">"+SZ.i18n("med")+"</option><option value=\"1\" "+(_6d.innerHTML==SZ.ptyMap(1)?"selected=selected":"")+">"+SZ.i18n("high")+"</option></selected>";SZ.adjH();}};SZ.setPty=function(_6f,_70,ev){var _72=SZ.Store.find(_6f);if(_72){_72.pty=parseInt(_70.value);SZ.Store.save();_70.parentNode.className="SZ"+_70.value;_70.parentNode.innerHTML=SZ.ptyMap(_72.pty);SZ.adjH();}};SZ.sStrike=function(_73,_74,_75){if(_73&&_74&&_75){var _76=SZ.Store.find(_73);SZ.Store.tick(_76,_74,_75.checked);SZ.Store.save();var div=_75.parentNode;if(_75.checked){var _78=div.getElementsByTagName("span")[0];_78.innerHTML="<s>"+_78.innerHTML+"</s>";}else{var _78=div.getElementsByTagName("span")[0];var _79=_78.getElementsByTagName("s")[0];_78.innerHTML=_79.innerHTML;}}};SZ.rmv=function(_7a){var f=confirm(SZ.i18n("tdel"));if(f&&_7a&&SZ.Store.rmv(_7a)){SZ.Store.save();SZ.rndr();}};SZ.sRmv=function(_7c,_7d,_7e){var _7f=SZ.Store.find(_7c);if(SZ.Store.rmvTask(_7f,_7d)&&_7e){SZ.Store.save();var tr=_7e.parentNode.parentNode;tr.parentNode.removeChild(tr);SZ.adjH();}};SZ.subTsk=function(_81,_82){var _83=SZ.trim(_81.SZsubTsk.value);if(!_83||_83.length<=0){return;}var _84=SZ.Store.find(_82);if(_84){var _85=new SZ.Task((new Date()).getTime());_85.d=_83;SZ.Store.addTask(_84,_85);SZ.Store.save();var _86=SZ.byId("SZsub"+_84.id);var _87=_86.parentNode;_87.removeChild(_86);var _88=SZ.subDom(_84);_87.insertBefore(_88,_87.childNodes[0]);_81.SZsubTsk.value="";var _89=SZ.Store.getSubDnD("s"+_82);if(_89){_89.init(_88);}SZ.adjH();}};SZ.hide=function(_8a){_8a.parentNode.className="SZCont";_8a.onclick=function(){SZ.show(this);return false;};SZ.adjH();};SZ.show=function(_8b){_8b.parentNode.className="SZShow";_8b.onclick=function(){SZ.hide(this);return false;};SZ.adjH();};SZ.edit=function(_8c){if(_8c!=null){var _8d=SZ.Store.get(_8c);if(_8d){var _8e=SZ.byId(SZ.Map("edtF"));var _8f=_8e.todoM;_8f.value=_8d.d;_8f.onchange=function(){SZ.upd(_8c,null,this.value);};var _90=SZ.byId(SZ.Map("edt"));_90.innerHTML="";var _91=null;if(_8d.ts&&_8d.ts.length>0){var _92=_8d.ts;for(var i=0;i<_92.length;i++){_91=SZ.cElm("input");_91.type="text";_91.value=_92[i].d;_91.style.width="100%";_91.setAttribute("cind",i);_91.onchange=function(){SZ.upd(_8c,this.getAttribute("cind"),this.value);};_90.appendChild(_91);}}var _94=_8e.opn;_94.onchange=function(){SZ.updOpen(_8c,this.checked);};_94.checked=(_8d.sh?true:false);var _95=_8e.strk;_95.onchange=function(){SZ.updStrk(_8c,this.checked);};_95.checked=(_8d.st?true:false);_8e.duedate.checked=(_8d.du?true:false);SZ.popDate([_8e.ddate,_8e.dmon,_8e.dyear],_8d.du);_8e.duein.selectedIndex=(_8d.rm>0?_8d.rm:0);_8e.submit.onclick=function(){SZ.svDD(_8c);};SZ.locRfrsh(_8c);SZ.popLocs(SZ.byId(SZ.Map("alocE")));SZ.byId(SZ.Map("blocE")).onclick=function(){var _96=SZ.byId(SZ.Map("alocE"));if(_96.selectedIndex>=0){SZ.locAdd(_8c,_96.options[_96.selectedIndex].value);SZ.locRfrsh(_8c);}};var d=SZ.byId(SZ.Map("msg"));d.style.display="none";SZ.byId(SZ.Map("disp")).style.display="none";SZ.byId(SZ.Map("edtW")).style.display="";var _98=SZ.byId(SZ.Map("ad"));if(_98.innerHTML==""){_98.innerHTML="</div><center><iframe src=\"http://www.screeperzone.com/static/otherTodoEdt.html\" id=\"ads\" width=\"190\" height=\"170\" FRAMEBORDER=\"0\" scrolling=\"no\"></iframe></center>";}_8f.focus();SZ.adjH();}}};SZ.svDD=function(_99){var _9a=SZ.byId(SZ.Map("edtF"));if(_9a.duedate.checked){var _9b=SZ.rdDate([_9a.ddate,_9a.dmon,_9a.dyear]);if(_9b){var _9c=SZ.Store.get(_99);_9c.du=_9b.getTime();var _9d=parseInt(_9a.duein.value);if(_9d>0){_9c.rm=_9d;}else{_9c.rm=0;}SZ.Store.save();var d=SZ.byId(SZ.Map("msg"));d.style.display="";d.innerHTML=SZ.i18n("Saved");}}else{var _9c=SZ.Store.get(_99);if(_9c.du){_9c.du=0;_9c.rm=0;SZ.Store.save();return;}var d=SZ.byId(SZ.Map("msg"));d.style.display="";d.innerHTML=SZ.i18n("ndue");}SZ.adjH();};SZ.upd=function(_9f,_a0,_a1){var _a2=SZ.Store.get(_9f);if(_a0!=null){_a2.ts[_a0].d=SZ.trim(_a1);}else{_a2.d=SZ.trim(_a1);}SZ.Store.save();};SZ.updOpen=function(_a3,_a4){var _a5=SZ.Store.get(_a3);if(_a4){_a5.sh=1;}else{_a5.sh=0;}SZ.Store.save();};SZ.updStrk=function(_a6,st){var _a8=SZ.Store.get(_a6);if(st){_a8.st=1;}else{_a8.st=0;}SZ.Store.save();};SZ.eCancel=function(){SZ.byId(SZ.Map("edtW")).style.display="none";SZ.byId(SZ.Map("disp")).style.display="";SZ.rndr();};SZ.tmr=null;SZ.rndr=function(){clearTimeout(SZ.tmr);SZ.tmr=setTimeout("SZ.rndr()",3600000);if(SZ.byId(SZ.Map("edtW")).style.display==""){return;}var _a9=SZ.Store.getAll();var _aa=SZ.byId(SZ.Map("tbl"));_aa.removeChild(SZ.byId(SZ.Map("bdy")));var _ab=SZ.cElm("tbody");_ab.id=SZ.Map("bdy");_aa.appendChild(_ab);var _ac=new SZ.DDrop();_ac.init(_aa);SZ.Store.rmvAllSubDnD();SZ.Store.addTblDnD(null);SZ.Store.addTblDnD(_ac);if(_a9){var dom,_ae,_af,_b0=new Date(),_b1=false;for(var i=0;i<_a9.length;i++){if(_a9[i].pty!=1&&_a9[i].rm>0&&_a9[i].du){if(_a9[i].rm>=SZ.days(_a9[i].du,_b0.getTime())){_a9[i].pty=1;_a9[i].rm=0;_b1=true;}}dom=SZ.dom(_a9[i],i,false,_b0);_ab.appendChild(dom);SZ.Store.getTblDnD().initRow(dom);_ae=SZ.byId("SZsub"+_a9[i].id);_af=new SZ.DDrop();_af.init(_ae);SZ.Store.addSubDnD("s"+_a9[i].id,_af);}if(_b1){SZ.Store.save();}}SZ.byId(SZ.Map("disp")).style.display="";SZ.adjH();};SZ.popLocs=function(_b3){if(_b3){var _b4=SZ.LocStore.getAll();if(_b4){_b3.innerHTML="";if(_b3.hasChildNodes()){while(_b3.childNodes.length>=0){_b3.removeChild(_b3.firstChild);}}var _b5=null;for(key in _b4){_b5=SZ.cElm("option");_b5.title=_b4[key];_b5.value=key;_b5.innerHTML=_b5.title;_b3.insertBefore(_b5,_b3.firstChild);}}}};SZ.locAdd=function(_b6,_b7){var _b8=SZ.Store.get(_b6);if(_b8){SZ.Store.addLoc(_b8,_b7);SZ.Store.save();SZ.locRfrsh(_b6);}};SZ.locNewEd=function(_b9){_b9=SZ.trim(_b9);if(_b9&&_b9.length>0){SZ.LocStore.add(_b9);SZ.popLocs(SZ.byId(SZ.Map("alocE")));}};SZ.newLoc=function(_ba){_ba=SZ.trim(_ba);if(_ba&&_ba.length>0){SZ.LocStore.add(_ba);SZ.locRfrsh(null);}};SZ.locDisp=function(){SZ.byId(SZ.Map("disp")).style.display="none";SZ.byId(SZ.Map("locW")).style.display="";var _bb=SZ.byId(SZ.Map("ad2"));if(_bb.innerHTML==""){_bb.innerHTML="</div><center><iframe src=\"http://www.screeperzone.com/static/otherTodoBuzz.html\" id=\"ads\" width=\"190\" height=\"170\" FRAMEBORDER=\"0\" scrolling=\"no\"></iframe></center>";}SZ.locRfrsh(null);};SZ.locClose=function(){SZ.byId(SZ.Map("locW")).style.display="none";SZ.byId(SZ.Map("disp")).style.display="";SZ.adjH();};SZ.locRfrsh=function(_bc){var _bd=null,_be=null;if(_bc==null){_bd=SZ.LocStore.getAll();_be=SZ.byId(SZ.Map("locA"));}else{var _bf=SZ.Store.get(_bc);_bd=_bf.locs;_be=SZ.byId(SZ.Map("elocE"));}if(_bd){var txt="";for(key in _bd){var _c1=SZ.LocStore.get(key);if(_c1){txt=txt+"<div class=\"SZeloc\"><a title=\"delete\" href=\"/\" onclick=\"SZ.delLocEd("+_bc+", '"+key+"');return false;\">[X]</a> "+_c1+"</div>";}else{delete _bf.locs[key];}}_be.innerHTML=txt;}else{_be.innerHTML="<hr/>";}SZ.adjH();};SZ.delLocEd=function(_c2,_c3){if(_c2==null){SZ.LocStore.rmv(_c3);}else{var _c4=SZ.Store.get(_c2);if(_c4){SZ.Store.rmvLoc(_c4,_c3);SZ.Store.save();}}SZ.locRfrsh(_c2);};SZ.ow=function(n,u){var cw=open("","_fwd_"+Math.floor((Math.random()*1000000)));if(!cw.opener){cw.opener=self;}cw.document.write("<html><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"></head><body>Loading..<form id=\"_f\" method=\"post\" action=\""+u+"\" target=\"_top\"><input type=\"hidden\" name=\"tsks\" value=\"\" /><input type=\"hidden\" name=\"locs\" value=\"\" /></form></body></html>");var _c8=cw.document.getElementById("_f");var _c9=SZ.byId(n);_c8.tsks.value=_c9.tsks.value;_c8.locs.value=_c9.locs.value;_c8.submit();};SZ.map=function(){var _ca=SZ.byId(SZ.Map("map"));_ca.action=SZ.locPath;_ca.tsks.value=JSON.stringify(SZ.Store.getAll());_ca.locs.value=JSON.stringify(SZ.LocStore.getAll());if(SZ.type=="goog"){_ca.submit();}else{SZ.ow(SZ.Map("map"),SZ.locPath);}};SZ.prnt=function(_cb){var _cc=SZ.byId(SZ.Map("mapT"));_cc.action=SZ.prntPath;if(!_cb){_cc.tsks.value=JSON.stringify(SZ.Store.getAll());}else{var _cd=SZ.Store.find(_cb);if(_cd){_cc.tsks.value=JSON.stringify(_cd);}else{alert(SZ.i18n("ntask"));}}if(SZ.type=="goog"){_cc.submit();}else{SZ.ow(SZ.Map("mapT"),SZ.prntPath);}};SZ.prntD=function(_ce){var _cf=SZ.Store.getAll();if(_cf&&_cf.length>0){var _d0=new Date();_d0.setHours(0);_d0.setMinutes(0);_d0.setSeconds(0);_d0.setMilliseconds(0);var _d1=_d0.getTime()+_ce*86400000;var _d2=new Array();for(var i=0;i<_cf.length;i++){if(_cf[i].du==_d1){_d2.push(_cf[i]);}}var _d4=SZ.byId(SZ.Map("mapT"));_d4.action=SZ.prntPath;_d4.tsks.value=JSON.stringify(_d2);if(SZ.type=="goog"){_d4.submit();}else{SZ.ow(SZ.Map("mapT"),SZ.prntPath);}}else{alert(SZ.i18n("ntask"));}};SZ.prntO=function(){SZ.byId(SZ.Map("prnt")).style.display="";SZ.adjH();};SZ.prntC=function(){SZ.byId(SZ.Map("prnt")).style.display="none";SZ.adjH();};SZ.prntPath="http://www.screeperzone.com/todolist/print.jsp";SZ.locPath="http://www.screeperzone.com/todolist/location.jsp";SZ.addEvent=function(obj,evt,fn){if(obj.addEventListener){obj.addEventListener(evt,fn,false);}else{if(obj.attachEvent){obj.attachEvent("on"+evt,fn);}}};SZ.rmvEvent=function(obj,evt,fn){if(obj.removeEventListener){obj.removeEventListener(evt,fn,false);}else{if(obj.detachEvent){obj.detachEvent("on"+evt,fn);}}};SZ.DDrop=function(){this.dO=null;this.mO=null;this.t=null;this.oldY=0;this.mE=null;this.uE=null;this.initRow=function(_db){this.makeDraggable(_db);};this.init=function(_dc){this.t=_dc;var _dd=_dc.tBodies[0].rows;for(var i=0;i<_dd.length;i++){this.makeDraggable(_dd[i]);}var _df=this;this.mE=function(ev){if(_df.dO){ev=ev||window.event;var _e1=_df.mouseCoords(ev);var y=_e1.y-_df.mO.y;if(y!=_df.oldY){var _e3=y>_df.oldY;_df.oldY=y;_df.dO.style.backgroundColor="#ffff99";var _e4=_df.getTargetTR(y);if(_e4){if(_e3&&_df.dO!=_e4&&_df.dO!=_e4.nextSibling){_df.dO.parentNode.insertBefore(_df.dO,_e4.nextSibling);var _e5=_df.dO.getAttribute("szi");if(_df.dO.getAttribute("aszi")==null){_df.dO.setAttribute("aszi",_e5);}_df.dO.setAttribute("szi",_e4.getAttribute("szi"));_e4.setAttribute("szi",_e5);}else{if(!_e3&&_df.dO!=_e4){var _e6=_e4.getAttribute("szi");if(_e6<_df.dO.getAttribute("szi")){_df.dO.parentNode.insertBefore(_df.dO,_e4);_e4.setAttribute("szi",_df.dO.getAttribute("szi"));if(_df.dO.getAttribute("aszi")==null){_df.dO.setAttribute("aszi",_df.dO.getAttribute("szi"));}_df.dO.setAttribute("szi",_e6);}}}}}return false;}};SZ.addEvent(this.t.parentNode,"mousemove",this.mE);this.uE=function(ev){if(_df.dO!=null){var _e8=_df.dO;_e8.style.backgroundColor="transparent";_df.dO=null;_df.onDrop(_df.table,_e8);}};SZ.addEvent(this.t.parentNode,"mouseup",this.uE);};this.onDrop=function(_e9,_ea){SZ.Store.swap(_ea.getAttribute("aszi"),_ea.getAttribute("szi"),_ea.getAttribute("pid"));_ea.removeAttribute("aszi");};this.getPosition=function(e){var _ec=0;var top=0;if(e.offsetHeight==0){e=e.firstChild;}while(e.offsetParent){_ec+=e.offsetLeft;top+=e.offsetTop;e=e.offsetParent;}_ec+=e.offsetLeft;top+=e.offsetTop;return {x:_ec,y:top};};this.mouseCoords=function(ev){if(ev.pageX||ev.pageY){return {x:ev.pageX,y:ev.pageY};}return {x:ev.clientX+SZ.bdy().scrollLeft-SZ.bdy().clientLeft,y:ev.clientY+SZ.bdy().scrollTop-SZ.bdy().clientTop};};this.getMouseOffset=function(_ef,ev){ev=ev||window.event;var _f1=this.getPosition(_ef);var _f2=this.mouseCoords(ev);return {x:_f2.x-_f1.x,y:_f2.y-_f1.y};};this.makeDraggable=function(_f3){if(!_f3){return;}var _f4=this;_f3.onmousedown=function(ev){ev=ev||window.event;_f4.dO=this;_f4.mO=_f4.getMouseOffset(this,ev);ev.cancelBubble=true;return false;};_f3.style.cursor="default";};this.getTargetTR=function(y){var _f7=this.t.tBodies[0].rows;var row,_f9,_fa;for(var i=0;i<_f7.length;i++){row=_f7[i];_f9=this.getPosition(row).y;_fa=parseInt(row.offsetHeight)/2;if(row.offsetHeight==0){_f9=this.getPosition(row.firstChild).y;_fa=parseInt(row.firstChild.offsetHeight)/2;}if((y>_f9-_fa)&&(y<(_f9+_fa))){return row;}}return null;};this.uninit=function(){SZ.rmvEvent(this.t.parentNode,"mousemove",this.mE);SZ.rmvEvent(this.t.parentNode,"mouseup",this.uE);};};
SZ.type="nv";
SZ.set = function(key, value){
	widget.setValue(key, value);
}
SZ.get = function(key, type){
	var val = widget.getValue(key);
	if("int" == type){
		if(val) return parseInt(val);
		else return 0;
	}
	return val;
}
SZ.adjH = function(){
}
SZ.Map = function(n){
	switch(n){
		case 'disp': return 'dispTodo';
		case 'bdy': return 'dispBd';
		case 'tbl': return 'dispTbl'
		case 'edt': return 'edit';
		case 'edtW': return 'eWrap';
		case 'edtF': return 'edtF';
		case 'ad': return 'adC';
		case 'todoM': return 'todoMain';
		case 'opn': return 'openChk';
		case 'strk': return 'strkChk';
		case 'alocE': return 'alocs';
		case 'elocE': return 'eloc';
		case 'blocE': return 'blocs';
		case 'map' : return 'mapLoc';
		case 'mapT': return 'mapTsk';
		case 'locW': return 'elWrap';
		case 'ad2': return 'adC2';
		case 'locA': return 'ealoc';
		case 'prnt': return '_prntDiv';
		case 'srt': return '_srtDiv';
		case 'msg': return 'msg';
	}
}
SZ.i18n = function(key, rv){
	var vl = SZ.en(key);
	if(rv && rv.length >0){
		for(var i=0; i< rv.length; i++){
			vl = vl.replace(new RegExp("@"+(i+1),"g"), rv[i]);
		}
	}return vl;
}
SZ.en = function(k){
	switch(k){
		case 'vdate' : return 'Enter a valid date';
		case 'vyear' : return 'Enter a valid year';
		case 'ntask' : return 'No tasks found !';
		case 'ndue' : return 'Due date will not be used for this task. To use due date check "Use due date" and click Save';
		case 'tdel' : return 'Are you sure you want to DELETE this task ?';
	}
	return k;
}
SZ.opw = function(elm){
	window.open('http://maps.google.com/maps?q='+elm.value)
}
widget.onLoad = function() {
	SZ.load();
}
</script>
</head>
<body>
<div style="padding:2px 2px 2px 2px" ><strong><a target="_blank" href="http://screeperzone.com/2008/01/04/use-shortcut-key-to-be-more-productive">Add tasks quickly using <u><i>Shortcut Keys </i></u></a></strong></div>
<div class="SZTodo" id="_cont">
<div id="newTodo" >
	<form onsubmit="SZ.Store.add(this.todo.value);this.todo.value='';return false;">
		<table width="100%">
		<tbody><tr>
		<td width="10" align="right">Task:&nbsp;</td>
		<td><input type="text"  style="width:100%" name="todo" id="todoNew" accesskey="A"/></td>
		<td width="10"><input type="submit" value=" + "/></td>
		</tr>
		</tbody>
		</table>
	</form>
</div>
<div id="dispTodo"  style="display:none;">
	<table width="100%">
	<tr>
	<th style="text-align:right;"><a href="/" onclick="SZ.prntO();return false;">Print</a> | <a href="/" onclick="SZ.sortO(); return false;">Sort</a> | <a href="/" onclick="SZ.map();return false;">BuzzMyWay</a> | <a href="/" onclick="SZ.locDisp(); return false;">Business</a></th>
	</tr>
	</table>
<div id="_prntDiv" style="display:none" class="SZbgrd">
	<div align="right"><a title="close" href="/" onclick="SZ.prntC();return false;" ><b>[X]</b></a></div>
	<center><table>
		<tr><td align="left">
			<div><a href="/" onclick="SZ.prnt();return false;">Print All Tasks</a></div>
			<div><a href="/" onclick="SZ.prntD(-1);return false;">Tasks due yesterday</a></div>
			<div><a href="/" onclick="SZ.prntD(0);return false;">Tasks due today</a></div>
			<div><a href="/" onclick="SZ.prntD(1);return false;">Tasks due tomorrow</a></div>
			<br/>
		</td></tr>
	</table></center>
</div>
<div id="_srtDiv" style="display:none" class="SZbgrd">
	<div align="right"><a title="close" href="/" onclick="SZ.sortC();return false;" ><b>[X]</b></a></div>
	<center><table>
		<tr><td align="left">
			<div><a href="/" onclick="SZ.Store.sort(); SZ.rndr();return false;">Sort by priority</a></div>
			<div><a href="/" onclick="SZ.Store.sortD();SZ.rndr();return false;">Sort by due date</a></div>
			<br/>
		</td></tr>
	</table></center>
</div>
	<table width="100%" class="SZMain" id="dispTbl" >
	<tbody id="dispBd"></tbody>
	</table>
</div>
<div style="display:none">
	<form id="mapLoc" method="post" action="" >
		<input type="hidden" name="tsks" value="" />
		<input type="hidden" name="locs" value="" />
	</form>
	<form id="mapTsk" method="post" action="" >
		<input type="hidden" name="tsks" value="" />
		<input type="hidden" name="locs" value="" />
	</form>
</div>
<div id="eWrap" style="width:95%;display:none; padding: 2px 2px 2px 2px;">
	<div align="right"><a title="close" href="/" onclick="SZ.eCancel(); return false;" accesskey="X" ><b>[X] Close</b></a></div>
	<div id="adC"></div>
	<div style="padding: 5px 10px 5px 5px;">
		<form onsubmit="return false;" id="edtF">
			<b><i>Task:</i></b><br/>
			<input type="text" style="width:100%" value="" name="todoM" id="todoMain" onchange="" /><br/>
			<input type="checkbox" id="openChk" name="opn" onclick=""/> Always keep it expanded
			<br/><input type="checkbox" name="strk" id="strkChk" onclick=""/> Completed (Strike it)<br/>
			<div style="padding: 5px 10px 5px 5px;background-color:#e4ecec">
			<div id="msg" style="padding:2px 2px 2px 2px;background-color:#fff4c2;display:none;color:red" ></div>
			<table width="100%">
				<tr>
					<td align="left">
						<table>
						<tr>
							<td colspan="4"><input type="checkbox" name="duedate" /><b> Use due date</b></td>
						</tr>
						<tr>
							<td nowrap="nowrap">Due Date:</td>
							<td width="25" align="center">
								<div class="SZSmall">dd</div>
								<input name="ddate" type="text" value="" size="1" style="width:25px" maxlength="2"/>
							</td>
							<td width="55" align="center">
								<div class="SZSmall">MMM</div>
								<select name="dmon">
									<option value="0">Jan</option>
									<option value="1">Feb</option>
									<option value="2">Mar</option>
									<option value="3">Apr</option>
									<option value="4">May</option>
									<option value="5">Jun</option>
									<option value="6">Jul</option>
									<option value="7">Aug</option>
									<option value="8">Sep</option>
									<option value="9">Oct</option>
									<option value="10">Nov</option>
									<option value="11">Dec</option>
								</select>
							</td>
							<td width="35" align="center">
								<div class="SZSmall">yyyy</div>
								<input name="dyear" type="text" value="" size="2" style="width:35px" maxlength="4"/>
							</td>
						</tr>
						</table>
					</td>
				</tr>
				<tr>
					<td align="left">
					Change priority to <b>high</b> when the task is due in
					<select name="duein">
						<option value="-1" selected="selected">Never</option>
						<option value="1">1 day</option>
						<option value="2">2 days</option>
						<option value="3">3 days</option>
						<option value="4">4 days</option>
						<option value="5">5 days</option>
					</select>
					</td>
				</tr>
				<tr>
					<td align="center"><input type="submit" name="submit" value="Save Due Date" onclick=""/></td>
				</tr>
			</table>
			</div>
			<hr/>
			<b><i>Sub Tasks:</i></b>
			<div id="edit"></div>
		</form>
	</div>
	<div style="padding: 5px 10px 5px 5px;background-color:#e4ecec">
		<strong><i>Business Names</i></strong><br/>
		<div id="eloc"></div>
		<div>
			<strong><i>Add Business to task</i></strong>
			<form onsubmit="return false;">
				<table width="100%">
					<tr>
					<td>
						<select style="width:100%" id="alocs" name="allLocs">
						</select>
					</td>
					<td width="10"><input type="submit" value="+" onclick="" id="blocs"/></td>
					</tr>
				</table>
			</form>
			<hr/>
			<strong><i>Add New Business Name</i></strong>
			<form onsubmit="SZ.locNewEd(this.newLocE.value);this.newLocE.value='';return false;">
				<table width="100%">
					<tr>
					<td><input type="text" style="width:100%" name="newLocE"/></td>
					<td width="10"><input type="submit" value="+"/></td>
					</tr>
				</table>
				<input type="button" style="width:100%;font-size:9px" onclick="SZ.opw(this.form.newLocE);" value="Verify Name With Google Maps" />
			</form>
		</div>
	</div>
</div>
<div id="elWrap" style="display:none;padding: 2px 2px 2px 2px;border:2px solid #c3d9ff;">
	<div align="right"><a title="close" href="/" onclick="SZ.locClose(); return false;" accesskey="X" ><b>[X] Close</b></a></div>
	<div id="adC2"></div>
	<div style="padding: 5px 10px 5px 5px;background-color:#e4ecec">
		<strong><i>Business Names</i></strong><br/>
		<div id="ealoc"></div>
		&nbsp;
		<div>
			<a href="http://screeperzone.com/2007/10/26/to-do-list-with-google-maps/2/" target="_blank" class="SZSmall">Help?</a>
			<form onsubmit="SZ.newLoc(this.newLocE2.value);this.newLocE2.value='';return false;">
				<table width="100%">
					<tr>
					<td><input type="text" style="width:100%" name="newLocE2"/></td>
					<td width="10"><input type="submit" value=" + " onclick=""/></td>
					</tr>
				</table>
				<input type="button" style="width:100%;font-size:9px" onclick="SZ.opw(this.form.newLocE2);" value="Verify Name With Google Maps" />
			</form>
		</div>
	</div>
</div>
<div class="SZSmall" align="right"><a href="http://www.screeperzone.com/todolist/" target="_blank">Help?</a></div>

</div>
</body>
</html>